package com.example.test2application;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class EventActivity extends Activity {

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.activity_event);
		
		// Get the application instance
		CustomApplication app = (CustomApplication)getApplication();

		TextView vtitle = (TextView) findViewById(R.id.title_event);
		TextView vdescr = (TextView) findViewById(R.id.description_event);
		TextView vcategory = (TextView) findViewById(R.id.category_event);
		TextView vdate = (TextView) findViewById(R.id.date_event);

		EventModel event = app.getEvent();
		vtitle.setText(event.getTitle());
		vdescr.setText(event.getDescription());
		
		SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
		Date date = event.getDate();
		vdate.setText(sdf.format(date));
		
		 vcategory.setText(event.getCategory());
	}
	
	
}
